<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ice="http://www.icesoft.com/icefaces/component">
    <h:body>
        <ui:composition template="./plantilla-sistema.xhtml">

            <ui:define name="popup">
                <ice:panelGroup id="dummy">
                    <ice:panelPopup id="cambiar"
                                    autoCentre="true"
                                    modal="true"
                                    visible="#{SessionBean.visible}">
                        <f:facet name="header">
                            <ice:panelGroup styleClass="popupHeaderWrapper">
                                <ice:outputText styleClass="popupHeaderText etiqueta" value="Formulario de Cambio de Clave"/>
                                <ice:commandButton id="modalPnlCloseBtn_2" type="button"
                                                   image="../imagenes/popupclose.gif"
                                                   actionListener="#{SessionBean.cierra}"
                                                   styleClass="popupHeaderImage"
                                                   title="Cerrar Ventana" value="" immediate="true" alt="Cerrar"/>
                            </ice:panelGroup>
                        </f:facet>
                        <f:facet name="body">
                            <ice:panelGroup styleClass="popupBody">
                                <!--Contenido HTML del PopPUP-->
                                <ui:include src="../webapp/usuarios/cambiarclave.jspx"></ui:include>
                            </ice:panelGroup>
                        </f:facet>
                    </ice:panelPopup>
                </ice:panelGroup>
                <ice:panelPopup autoCentre="true" modal="true" id="popup_vent" visible="#{eventos.popup_visible}">
                    <f:facet name="header">
                        <ice:panelGroup styleClass="popupHeaderWrapper">
                            <ice:outputText styleClass="popupHeaderText etiqueta" value="#{eventos.popup_header}"/>
                            <ice:commandButton id="modalPnlCloseBtn" type="button"
                                               image="../imagenes/popupclose.gif"
                                               actionListener="#{eventos.cierra_popup}"
                                               styleClass="popupHeaderImage"
                                               title="Cerrar Ventana" value="" immediate="true" alt="Cerrar"/>
                        </ice:panelGroup>
                    </f:facet>
                    <f:facet name="body">
                        <ice:panelGroup styleClass="popupBody">
                            <!--Contenido HTML del PopPUP-->
                            #{eventos.popup_conten}
                            <br/>
                            <ice:commandButton value="Aceptar"
                                               styleClass="boton"
                                               type="submit"

                                               id="btn_1" immediate="true" actionListener="#{eventos.cierra_popup}"/>
                            <ice:commandButton value="Cerrar"
                                               styleClass="boton"
                                               type="submit"

                                               id="btn2" immediate="true" actionListener="#{eventos.cierra_popup}"/>
                        </ice:panelGroup>
                    </f:facet>
                </ice:panelPopup>
            </ui:define>

            <ui:define name="top">
                <ice:panelGrid id="cabezera"  cellpadding="0" cellspacing="0" width="100%" columns="1">
                    <f:facet name="header">
                        <div style="background:url('../imagenes/main-bg.gif') repeat-x scroll left top #FFFFFF">
                            <ice:graphicImage width="165" height="65" url="./../#{msg.path_imagen_login}" style="padding-bottom: 4px;"></ice:graphicImage>
                        </div>
                    </f:facet>

                    <ice:panelGroup style="text-aling:center;margin-left: 0px;height:45;background:url('../imagenes/mainnav-lbg.gif') no-repeat scroll left bottom transparent;" >
                        <div style="margin-top: 0px; padding-top: 15px;float:left;width: 700px;">
                            <span style="margin-left: 10px;"></span>
                            <ice:outputLabel value="#{msg.Bienvenido}"></ice:outputLabel>
                            <ice:commandLink immediate="true" value="#{SessionBean.usu_login.nombre} #{SessionBean.usu_login.apellido}" actionListener="#{SessionBean.abrirpopup}" title="clic para modificar la clave"/>
                            <ice:outputLabel value="!"></ice:outputLabel>
                            <span style="margin-left: 10px;"></span>
                            <span style="margin-left: 10px;"></span>
                            <ice:outputLabel value="#{msg.Rol}"></ice:outputLabel>

                            <span style="margin-left: 10px;"></span>
                            <ice:outputLabel value="#{msg.Fecha}"></ice:outputLabel>
                            <ice:outputLabel style="font-weight:normal" value="#{SessionBean.fecha_actual}"><f:convertDateTime dateStyle="medium" type="both" timeZone="America/Bogota"></f:convertDateTime></ice:outputLabel>
                            <ice:commandLink  value="#{msg.Cerrar_session}" style="margin-left:10px" immediate="true" actionListener="#{SessionBean.cerrar_sesion}"></ice:commandLink>

                        </div>
                        <div style="float:right;width:42px">
                            <ice:outputConnectionStatus showPopupOnDisconnect="true" id="estado_conexion"></ice:outputConnectionStatus>
                        </div>
                    </ice:panelGroup>

                </ice:panelGrid>
            </ui:define>

            <ui:define name="izquierda_panel">
                <ice:panelGroup styleClass="pnlClpsblWrapper panelCollapsible">  
                    <h3 style="text-align:center;font-size:13px;" class="panel">MENU</h3>
                    <ice:panelCollapsible id="inspecciones"  expanded="#{SessionBean.panels[0]}" actionListener="#{SessionBean.tooglePanel}" immediate="true">
                        <f:facet name="header">
                            <ice:panelGroup>
                                <ice:outputText id="inspecciones_header" value="Reportes de Instalación"/>
                            </ice:panelGroup>
                        </f:facet>
                        <ice:panelGrid columns="2" width="100%">
                            <p:commandLink action="#{SessionBean.navegador}" immediate="true" oncomplete="updateContent()" update="@none" >
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/sube.PNG"/>
                                Inportar
                                <f:param name="source" value="./../webapp/importarReporte.xhtml" />
                              <!--  <f:param name="source" value="./../webapp/ice.xhtml" /> -->
                            </p:commandLink>
                            <p:commandLink action="#{SessionBean.navegador}" immediate="true" oncomplete="updateContent()" update="@none" >
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/baja.PNG"/>
                                Descargar
                                <f:param name="source" value="./../webapp/DescargarReporte.xhtml" />
                            </p:commandLink>
                            <p:commandLink action="#{SessionBean.navegador}" immediate="true" oncomplete="updateContent()" update="@none" >
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/portal_icon.png"/>
                                Pantalla 3
                                <f:param name="source" value="./../webapp/ice_1.xhtml" />
                            </p:commandLink>
                            <p:commandLink action="#{SessionBean.navegador}" immediate="true" oncomplete="updateContent()" update="@none" >
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/backupserver.gif"/>
                                Pantalla 4
                                <f:param name="source" value="./../webapp/ice_1.xhtml" />
                            </p:commandLink>
                        </ice:panelGrid>
                    </ice:panelCollapsible>
                    <ice:panelCollapsible id="clientes" expanded="#{SessionBean.panels[1]}" actionListener="#{SessionBean.tooglePanel}" immediate="true">
                        <f:facet name="header">
                            <ice:panelGroup>
                                <ice:outputText id="clientes_header" value="Clientes"/>
                            </ice:panelGroup>
                        </f:facet>
                        <ice:panelGrid columns="2" width="100%">
                            <p:commandLink action="#{SessionBean.navegador}" immediate="true" oncomplete="updateContent()" update="@none" >
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/ico-groups.gif"></ice:graphicImage>
                                Pantalla 2.1
                                <f:param name="source" value="./../webapp/ice_1.xhtml" />
                            </p:commandLink>
                            <p:commandLink action="#{SessionBean.navegador}" immediate="true" oncomplete="updateContent()" update="@none" >
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/portal_icon.png"></ice:graphicImage>
                                Pantalla 2.2
                                <f:param name="source" value="./../webapp/ice_1.xhtml" />
                            </p:commandLink>
                        </ice:panelGrid>
                    </ice:panelCollapsible>
                    <ice:panelCollapsible id="tablas" expanded="#{SessionBean.panels[2]}" 
                                          actionListener="#{SessionBean.tooglePanel}"
                                          immediate="true" rendered="#{SessionBean.usu_login.esadmin or SessionBean.manager}">
                        <f:facet name="header">
                            <ice:panelGroup>
                                <ice:outputText id="tablas_header" value="Mantenimiento de Tablas"/>
                            </ice:panelGroup>
                        </f:facet>
                        <ice:panelGrid columns="2" width="100%">
                            <ice:commandLink id="newCiudad" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/city.gif"></ice:graphicImage>
                                Ciudades
                                <f:attribute name="pagina" value="mantenimientos/newCiudad.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="newInspector" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/assign.gif"></ice:graphicImage>
                                Inspectores
                                <f:attribute name="pagina" value="mantenimientos/newInspector.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="newAgencia" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/company.gif"></ice:graphicImage>
                                Agencias
                                <f:attribute name="pagina" value="mantenimientos/newAgencia.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="newMotivo" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/tbarChat.gif"></ice:graphicImage>
                                Motivos
                                <f:attribute name="pagina" value="mantenimientos/newMotivo.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="newNovedad" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/btnL3Tracker.gif"></ice:graphicImage>
                                Novedades
                                <f:attribute name="pagina" value="mantenimientos/newNovedad.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="newCampo" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/orgshar.gif"></ice:graphicImage>
                                Campos
                                <f:attribute name="pagina" value="mantenimientos/newCampo.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="newLiquidador" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/btnL3Calc.gif"></ice:graphicImage>
                                Liquidador
                                <f:attribute name="pagina" value="mantenimientos/newLiquidador.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="newTiposervicio" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/terms.gif"></ice:graphicImage>
                                Tipo Servicio
                                <f:attribute name="pagina" value="mantenimientos/newTiposervicio.jspx" />
                            </ice:commandLink>
                        </ice:panelGrid>
                    </ice:panelCollapsible>
                    <ice:panelCollapsible id="usuarios_roles" expanded="#{SessionBean.panels[3]}" actionListener="#{SessionBean.tooglePanel}" immediate="true" rendered="#{SessionBean.usu_login.esadmin}">
                        <f:facet name="header">
                            <ice:panelGroup>
                                <ice:outputText id="usuarios_roles_header" value="Usuarios y Roles"/>
                            </ice:panelGroup>
                        </f:facet>
                        <ice:panelGrid columns="2" width="100%">
                            <ice:commandLink id="newUsuarios" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/ico-users.gif"></ice:graphicImage>
                                Usuarios
                                <f:attribute name="pagina" value="usuarios/newUsuario.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="roles" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/ico-roles.gif"></ice:graphicImage>
                                Mantener Roles
                                <f:attribute name="pagina" value="usuarios/roles.jspx" />
                            </ice:commandLink>
                            <ice:commandLink id="audit" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/audit.gif"></ice:graphicImage>
                                Auditoria de usuarios
                                <f:attribute name="pagina" value="usuarios/audit.jspx" />
                            </ice:commandLink>
                        </ice:panelGrid>
                    </ice:panelCollapsible>
                    <ice:panelCollapsible id="mantenimiento" expanded="#{SessionBean.panels[4]}" actionListener="#{SessionBean.tooglePanel}" rendered="#{SessionBean.usu_login.esadmin}" immediate="true">
                        <f:facet name="header">
                            <ice:panelGroup>
                                <ice:outputText id="mantenimiento_header" value="Mantenimiento del Sistema"/>
                            </ice:panelGroup>
                        </f:facet>
                        <ice:panelGrid columns="2" width="100%">
                            <ice:commandLink id="newBackup" immediate="true" actionListener="#{eventos.cambiar_pagina}">
                                <ice:graphicImage width="25" height="25" style="border:none" value="../imagenes/backupserver.gif"></ice:graphicImage>
                                Respaldo BD
                                <f:attribute name="pagina" value="sistema/backup.jspx" />
                            </ice:commandLink>
                            <ice:commandLink rendered="false">
                                <ice:graphicImage rendered="false" width="25" height="25" style="border:none" value="../imagenes/settingsWorkflow.png"></ice:graphicImage>
                                Sincronizacion SICO
                            </ice:commandLink>
                        </ice:panelGrid>
                    </ice:panelCollapsible>
                    <p:remoteCommand name="updateContent" process="@none" update="content" />
                </ice:panelGroup>
            </ui:define>

            <ui:define name="derecha_panel" id="derecha_panel">
                <ui:insert name="contenido">
                        <p:outputPanel id="content">
                        <ui:include src="#{SessionBean.includedPage}"> 

                        </ui:include>
                    </p:outputPanel>
                </ui:insert>
            </ui:define>

            <ui:define name="bottom">
                bottom Poner aqui informacion del pie de pagina
            </ui:define>

        </ui:composition>



    </h:body>
</html>
